package cn.cau.epidemicsurveysystem.bean;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "epidInfoCollection", schema = "gp2022", catalog = "")
public class EpidInfoCollectionBean {
    private int epidInfoId;
    private Integer patientId;
    private String patientName;
    private Integer assigneeId;
    private String assigneeName;
    private Timestamp surveyTime;
    private String surveyLocation;
    private String epidResults;

    @Id
    @Column(name = "epidInfoId")
    public int getEpidInfoId() {
        return epidInfoId;
    }

    public void setEpidInfoId(int epidInfoId) {
        this.epidInfoId = epidInfoId;
    }

    @Basic
    @Column(name = "patientId")
    public Integer getPatientId() {
        return patientId;
    }

    public void setPatientId(Integer patientId) {
        this.patientId = patientId;
    }

    @Basic
    @Column(name = "patientName")
    public String getPatientName() {
        return patientName;
    }

    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }

    @Basic
    @Column(name = "assigneeId")
    public Integer getAssigneeId() {
        return assigneeId;
    }

    public void setAssigneeId(Integer assigneeId) {
        this.assigneeId = assigneeId;
    }

    @Basic
    @Column(name = "assigneeName")
    public String getAssigneeName() {
        return assigneeName;
    }

    public void setAssigneeName(String assigneeName) {
        this.assigneeName = assigneeName;
    }

    @Basic
    @Column(name = "surveyTime")
    public Timestamp getSurveyTime() {
        return surveyTime;
    }

    public void setSurveyTime(Timestamp surveyTime) {
        this.surveyTime = surveyTime;
    }

    @Basic
    @Column(name = "surveyLocation")
    public String getSurveyLocation() {
        return surveyLocation;
    }

    public void setSurveyLocation(String surveyLocation) {
        this.surveyLocation = surveyLocation;
    }

    @Basic
    @Column(name = "epidResults")
    public String getEpidResults() {
        return epidResults;
    }

    public void setEpidResults(String epidResults) {
        this.epidResults = epidResults;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        EpidInfoCollectionBean that = (EpidInfoCollectionBean) o;

        if (epidInfoId != that.epidInfoId) return false;
        if (patientId != null ? !patientId.equals(that.patientId) : that.patientId != null) return false;
        if (patientName != null ? !patientName.equals(that.patientName) : that.patientName != null) return false;
        if (assigneeId != null ? !assigneeId.equals(that.assigneeId) : that.assigneeId != null) return false;
        if (assigneeName != null ? !assigneeName.equals(that.assigneeName) : that.assigneeName != null) return false;
        if (surveyTime != null ? !surveyTime.equals(that.surveyTime) : that.surveyTime != null) return false;
        if (surveyLocation != null ? !surveyLocation.equals(that.surveyLocation) : that.surveyLocation != null)
            return false;
        if (epidResults != null ? !epidResults.equals(that.epidResults) : that.epidResults != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = epidInfoId;
        result = 31 * result + (patientId != null ? patientId.hashCode() : 0);
        result = 31 * result + (patientName != null ? patientName.hashCode() : 0);
        result = 31 * result + (assigneeId != null ? assigneeId.hashCode() : 0);
        result = 31 * result + (assigneeName != null ? assigneeName.hashCode() : 0);
        result = 31 * result + (surveyTime != null ? surveyTime.hashCode() : 0);
        result = 31 * result + (surveyLocation != null ? surveyLocation.hashCode() : 0);
        result = 31 * result + (epidResults != null ? epidResults.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "EpidInfoCollectionBean{" +
                "epidInfoId=" + epidInfoId +
                ", patientId=" + patientId +
                ", patientName='" + patientName + '\'' +
                ", assigneeId=" + assigneeId +
                ", assigneeName='" + assigneeName + '\'' +
                ", surveyTime=" + surveyTime +
                ", surveyLocation='" + surveyLocation + '\'' +
                ", epidResults='" + epidResults + '\'' +
                '}';
    }
}
